package com.spzx.product.api;

import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.product.api.domain.VO.ItemVO;
import com.spzx.product.api.factory.RemoteItemServiceFallbackFactory;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(contextId = "RemoteItemService"
        , value = ServiceNameConstants.PRODUCT_SERVICE
        , fallbackFactory = RemoteItemServiceFallbackFactory.class)
public interface RemoteItemService {
    @GetMapping("/product/item/{skuId}")
    @Operation(summary = "内部接口:商品详情")
    ItemVO itemById(@RequestHeader(SecurityConstants.FROM_SOURCE) String s, @SpringQueryMap Long id);
}
